# -*- coding: utf-8 -*-

def url_without_key(key, querydict):
    """
    Return an encoded querydict without the passed *key* (if present).
    """
    querydict = querydict.copy()
    if key in querydict:
        del querydict[key]
    return "?%s" % querydict.urlencode()
    
def multicallbacks(*args):
    """
    Take in *args a list of callback to be executed in order.
    """
    def callback(field, objects):
        for i in args:
            objects = i(field, objects)
        return objects
    return callback